package com.imooc.o2o.dto;

import com.imooc.o2o.entity.Shop;
import com.imooc.o2o.enums.ShopStateEnum;
import lombok.Data;

import java.util.List;

/**
 * @author 徐老板
 * @date 2020/1/1   21:02
 */
@Data
public class ShopExecution {
    //结果状态
    private int state;

    //返回 信息
    private String stateInfo;

    //店铺数量
    private int count;

    //对店铺操作的增删改
    private Shop shop;

    //店铺列表
    private List<Shop> shopList;

    //准备构造器用于返回参数
    public ShopExecution(){};

    //失败的构造器 只会返回状态码和对应的提示信息
    public ShopExecution(ShopStateEnum stateEnum){
        this.state=stateEnum.getState();
        this.stateInfo=stateEnum.getStateInfo();
    }

    //成功的构造器会返回状态码和商店信息
    public  ShopExecution(ShopStateEnum stateEnum,Shop shop){
        this.state=stateEnum.getState();
        this.stateInfo=stateEnum.getStateInfo();
        this.shop=shop;
    }

    //成功的构造器会返回状态码和商店列表信息
    public  ShopExecution(ShopStateEnum stateEnum,List<Shop> shopList){
        this.state=stateEnum.getState();
        this.stateInfo=stateEnum.getStateInfo();
        this.shopList=shopList;
    }

}
